import { lazy } from "react";
import { AppOutline,AppstoreOutline } from 'antd-mobile-icons'

let Login = lazy(() => import("../page/login"));
let Mainlayout = lazy(() => import("../page/mainlayout"));
let Error = lazy(() => import("../page/404"));
let City = lazy(()=>import('../page/city'))
let List = lazy(()=>import('../page/list'))

let Home = lazy(() => import("../page/home"));
let Porps = lazy(() => import("../page/porps"));
let Message = lazy(() => import("../page/message"));
let User = lazy(() => import("../page/user"));

export const homeroute = [
  {
    path: "/",
    element: <Home></Home>,
    title:'首页',
    icon:<AppOutline />
  },
  {
    path: "/porps",
    element: <Porps></Porps>,
    title:'分类',
    icon:<AppstoreOutline />
  },
  {
    path: "/message",
    element: <Message></Message>,
    title:'消息',
    icon:<AppOutline />
  },
  {
    path: "/user",
    element: <User></User>,
    title:'我的',
    icon:<AppOutline />
  },
];

export const route = [
  {
    path: "/",
    element: <Mainlayout></Mainlayout>,
    children: homeroute,
  },
  {
    path: "/login",
    element: <Login></Login>,
  },
  {
    path: "/city/:type",
    element: <City></City>,
  },
  {
    path: "/list",
    element: <List></List>,
  },
  {
    path: "*",
    element: <Error></Error>,
  },
];
